import { AxiosRequestConfig } from 'axios';
import http from '@/utils/http';

export async function getVehiclesTree(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetCarTreeStruct',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}

export async function listVehicles(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetCurrentCarPictures',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}
export async function listVehiclesleft(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetLeftCurrentCarPictures',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}


export async function searchVehicles(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetCarPicsByCarCode',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}

export async function gethVehicle(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetcarDetail',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}

export async function gethVehicleleft(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/GetLeftcarDetail',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}

export async function virtually(config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url: '/api/CarCategory/upload/vmcarinfo',
        method: 'POST',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}


export async function Echoinfo(id: number, config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url:  `/api/CarCategory/get/format/${id}`,
        method: 'GET',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}
export async function Echoinfoleft(id: number, config?: AxiosRequestConfig<any>) {
    const _config = <AxiosRequestConfig<any>>{
        url:  `/api/left/CarCategory/get/format/${id}`,
        method: 'GET',
        ...config,
    };
    const response = await http.request(_config);
    return response.data;
}




// export async function Echoinfaso(id: number, config?: AxiosRequestConfig<any>) {
//     const _config = <AxiosRequestConfig<any>>{
//         url: `/api/CarCategory/get/format/${id}`, // 上传车型的实拍图回显
//         method: 'GET',
//         ...config,
//     };
//     const response = await http.request(_config);
//     return response.data;
// }
